var Blcok = function(position) {
    // position is [0,0]

    var p = position

    var image = imageFromPath('block.png')
    var o = {
        image:image,
        x:p[0],
        y:p[1],
        w:50,
        h:20,
        alive:true,
        lifes: p[2] || 1,
    }

    o.kill1 = function () {
        o.alive = false
        
    }
    o.kill = function () {
        o.lifes--        
        if(o.lifes < 1)
        {
            o.alive = false
            log(o.alive)                        
        }
        
    }

    o.collide = function (b) {
        return o.alive && (rectIntersect(o, b) || rectIntersect(b, o))
    }
    return o
}